// 'use strict';




var log4js = require('log4js');
var logger = log4js.getLogger('INVOKE');

var express = require('express')
var app = express()

var mover = require('./move_asset.js');
mover.init();

var queryer = require('./query.js');
queryer.init();

var asset = require('./make_asset.js');
asset.init();

app.use(express.static('.'));

app.get('/move/:from-:to-:count', function (req, res) {
  mover.move(req.params.from,req.params.to,req.params.count, req, res)
})

app.get('/query/:id', function (req, res) {
  queryer.query(req.params.id,req, res);
})

app.get('/assets/:id-:amount', function (req, res) {
  asset.make(req.params.id, req.params.amount, req, res);
})

app.get('/', function (req, res) {
  res.sendFile(__dirname+'/index.html');
})

app.listen(9999);